package C10_14_ReplaceErrorCodeWithException.after_refactor_1非受控异常;

/**
 * 调用者有责任在调用前检查必要状态，就抛出非受控异常
 */
public class Account {
    private int _balance;
    void withdraw(int amount) {
        if (amount > _balance)
            throw new IllegalArgumentException("Amount too large");
        _balance -= amount;
    }
}
